import request from '@/config/axios'

// 销售采购订单关联 VO
export interface OrderMappingVO {
  id: string // ID
  vendorCode: string // 供应商编码
  displayPoNumber: string // 采购订单号
  vendorSaleOrder: string // 销售订单号
  saleOrderStatus: string // 销售订单状态
  status: number // 状态（0正常 1关闭）
}

// 销售采购订单关联 API
export const OrderMappingApi = {
  // 查询销售采购订单关联分页
  getOrderMappingPage: async (params: any) => {
    return await request.get({ url: `/ck/order-mapping/page`, params })
  },

  // 查询销售采购订单关联详情
  getOrderMapping: async (id: number) => {
    return await request.get({ url: `/ck/order-mapping/get?id=` + id })
  },

  // 新增销售采购订单关联
  createOrderMapping: async (data: OrderMappingVO) => {
    return await request.post({ url: `/ck/order-mapping/create`, data })
  },

  // 修改销售采购订单关联
  updateOrderMapping: async (data: OrderMappingVO) => {
    return await request.put({ url: `/ck/order-mapping/update`, data })
  },

  // 删除销售采购订单关联
  deleteOrderMapping: async (id: number) => {
    return await request.delete({ url: `/ck/order-mapping/delete?id=` + id })
  },

  // 导出销售采购订单关联 Excel
  exportOrderMapping: async (params) => {
    return await request.download({ url: `/ck/order-mapping/export-excel`, params })
  },
}